package com.neuedu.api;

public class Person {

    private String name;
    private Integer age;  //当类用  还可以进行基础数据类型的 运算   默认为null


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Person person = new Person();
//        person.age = 10*0;
        System.out.println(person.age);


        /**
         * boolean	Boolean
         * byte	Byte
         * char	Character
         * double	Double
         * float	Float
         * int	Integer
         * long	Long
         * short	Short
         */
        //包装类型
        Integer intObj1 = new Integer(10);
        Integer intObj2 = new Integer(10);

        System.out.println(intObj1.intValue() == intObj2.intValue());
        System.out.println("(intObj1 == intObj2) = " + (intObj1 == intObj2));

        //字符串转换成  int  double
        Integer str2Int = Integer.valueOf("60");
        Double str2Double = Double.valueOf("60.5");

        //包装类型转成 字符串  包装类型的toString 重写    getClass@Integer.toHexString(hashcode)
        System.out.println("(str2Int.toString()) = " + (str2Int.toString()));


        //基础类型转换成包装类
        int numa = 100;
//        Integer intNum = new Integer(numa);
        Integer intNum = Integer.valueOf(numa);

        //包装类型 转换成基础类型    .xxxxValue
        Double doubtNum = Double.valueOf(3.14);
        double numb = doubtNum.doubleValue();

        System.out.println("(doubtNum+1) = " + (doubtNum + 1));

        //1.5+ 自动拆箱
        int  numc = new Integer(100);
        //1.5+ 自动装箱
        Double db = 3.15;




        //
        String sta1 =  "Hello World";
        String sta2 =  "Hello World";
        String sta3 =  new String("Hello World");
        System.out.println("(sta1 == sta2) = " + (sta1 == sta2)); //
        System.out.println("(sta2 == sta3) = " + (sta2 == sta3));


        Integer ingr1 = 100;
        Integer ingr2 = 100;

        Integer ingr3 = 127;
        Integer ingr4 = 127;

        System.out.println("(ingr1 == ingr2) = " + (ingr1 == ingr2));
        System.out.println("(ingr3 == ingr4) = " + (ingr3 == ingr4));

        Integer ingr5 = 100;
        int fifty = 50;
        Integer ingr6 = fifty + 50;

        System.out.println("(ingr5 == ingr6) = " + (ingr5 == ingr6));

        String myInfo1 = "my name is "+ "jshand";
        String myInfo2 = "my name is jshand";

        System.out.println("(        myInfo1 == myInfo2) = " + (myInfo1 == myInfo2));
    }
}
